import request, {failHandler, jsonPost, reqGet} from '@/utils/request';

export const loginApis = {
  pswLogin: '/api/login',
  logout: '/api/logout'
};



/**
 * 用户登录
 * @param params
 * @param option
 * @returns {*}
 */
export async function userLogin(params, option) {
  return request(loginApis.pswLogin, {
    method: 'post',
    // mode: 'cors',
    requestType: 'form',
    data: params,
  }).then((res) => {
    return failHandler(res ? res.data : res);
  });
  // return jsonPost(loginApis.pswLogin, params, option);
}

/**
 * 退出登录
 */
export async function logout() {
  return jsonPost(loginApis.logout);
}

